/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ipfms.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author fikri
 */
@Embeddable
public class BuildingImgPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id_img")
    private int idImg;
    @Basic(optional = false)
    @Column(name = "id_building")
    private int idBuilding;

    public BuildingImgPK() {
    }

    public BuildingImgPK(int idImg, int idBuilding) {
        this.idImg = idImg;
        this.idBuilding = idBuilding;
    }

    public int getIdImg() {
        return idImg;
    }

    public void setIdImg(int idImg) {
        this.idImg = idImg;
    }

    public int getIdBuilding() {
        return idBuilding;
    }

    public void setIdBuilding(int idBuilding) {
        this.idBuilding = idBuilding;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idImg;
        hash += (int) idBuilding;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BuildingImgPK)) {
            return false;
        }
        BuildingImgPK other = (BuildingImgPK) object;
        if (this.idImg != other.idImg) {
            return false;
        }
        if (this.idBuilding != other.idBuilding) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ipfms.model.BuildingImgPK[ idImg=" + idImg + ", idBuilding=" + idBuilding + " ]";
    }
    
}
